﻿
/*----------------------------------------------------------------//
// 文件名：MoActLog.cs
// 文件功能描述：实体 MoActLog.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-19
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoActLog
using System;
using System.Data;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoActLog
	/// </summary>
	public partial class MoActLog:ICloneable
	{
		#region 表ActLog的字段
		private int logId;
		private string uid;
		private string actCode;
		private DateTime actTime;
		private string actInfo;
		#endregion
		
		#region 构造函数
		public MoActLog()
		{
			   actTime=new DateTime(1900,1,1);   	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoActLog(MoActLog item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoActLog(int logId,string uid,string actCode,DateTime actTime,string actInfo)
		{
		this.logId=logId;
		this.uid=uid;
		this.actCode=actCode;
		this.actTime=actTime;
		this.actInfo=actInfo;
		}
		#endregion
		
		#region 表ActLog的字段属性
		/// <summary>
		/// LOG_ID
		/// </summary>
		public int LogId
		{
			get {return logId;}
			set {logId=value;}
		}
		/// <summary>
		/// UID
		/// </summary>
		public string Uid
		{
			get {return uid;}
			set {uid=value;}
		}

		/// <summary>
		///操作代码需要统一编码。目前明确的编码有：
       ///登入：LOGON_ACT
       ///登出：LOGOUT_ACT
       ///一般操作：NORMAL_ACT
       ///考勤登入：CHECK_IN_ACT
       ///考勤登出:CHECK_OUT_ACT
		/// </summary>
		public string ActCode
		{
			get {return actCode;}
			set {actCode=value;}
		}
		/// <summary>
		/// ACT_TIME
		/// </summary>
		public DateTime ActTime
		{
			get {return actTime;}
			set {actTime=value;}
		}
		/// <summary>
		/// ACT_INFO
		/// </summary>
		public string ActInfo
		{
			get {return actInfo;}
			set {actInfo=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoActLog CopyTo(MoActLog item)
        {
		    item.logId=this.logId;
		    item.uid=this.uid;
		    item.actCode=this.actCode;
		    item.actTime=this.actTime;
		    item.actInfo=this.actInfo;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoActLog mo=new MoActLog();
		    mo.LogId=this.LogId;
		    mo.Uid=this.Uid;
		    mo.ActCode=this.ActCode;
		    mo.ActTime=this.ActTime;
		    mo.ActInfo=this.ActInfo;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoActLog NewActLog = obj as MoActLog;
                if (NewActLog == null)
                {
                    return false;
                }
                else
                {
				if (NewActLog.LogId==this.LogId && NewActLog.Uid==this.Uid && NewActLog.ActCode==this.ActCode && NewActLog.ActTime==this.ActTime && NewActLog.ActInfo==this.ActInfo)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"LogId={0}/Uid={1}/ActCode={2}/ActTime={3}/ActInfo={4}",logId,uid,actCode,actTime,actInfo);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["LOG_ID"]!=null && row["LOG_ID"]!=DBNull.Value)
			{
			    this.LogId = (int)row["LOG_ID"];
			}
			else
			{
				this.LogId =0;
			}
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["ACT_CODE"]!=null && row["ACT_CODE"]!=DBNull.Value)
			{
			    this.ActCode = (string)row["ACT_CODE"];
			}
			else
			{
				this.ActCode =string.Empty;
			}
		    if(row["ACT_Time"]!=null && row["ACT_Time"]!=DBNull.Value)
			{
			    this.ActTime = (DateTime)row["ACT_Time"];
			}
			else
			{
				this.ActTime =DateTime.MinValue;
			}
		    if(row["ACT_INFO"]!=null && row["ACT_INFO"]!=DBNull.Value)
			{
			    this.ActInfo = (string)row["ACT_INFO"];
			}
			else
			{
				this.ActInfo =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["LOG_ID"] = this.LogId;
			row["UID"] = this.Uid;
			row["ACT_CODE"] = this.ActCode;
			row["ACT_Time"] = this.ActTime;
			row["ACT_INFO"] = this.ActInfo;
		}
		#endregion
	}
}
#endregion
